package com.leff.cards.web.requests;

import com.leff.cards.data.ResponseCard;
import com.leff.cards.util.Dictionary;
import com.leff.cards.web.WebRequest;
import com.leff.notifications.NotificationCenter;

public class SubmitRequest extends WebRequest {
	
	public static final String CARDS_SUBMITTED = "CardsSubmitted";
	
	public SubmitRequest(long groupId, long userId, ResponseCard[] cards) {
		super(WebCommand.SUBMIT_CARD);
		
		mParameters.put(Parameter.GROUP_ID, groupId);
		mParameters.put(Parameter.ID, userId);
		mParameters.put(Parameter.CARD_IDS, encodeCards(cards));
	}

	@Override
	protected void parseResultDictionary(Dictionary dict) {
		
		NotificationCenter.postNotification(CARDS_SUBMITTED, "Cards Submitted");
	}
}
